package com.tang.model.itrerator;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/3 21:34
 * @Desc
 * @Remarks
 */
public class Test {
    public static void main(String[] args) {
        Course java = new Course("java");
        Course python = new Course("python");
        Course ai = new Course("ai");
        Course designer = new Course("designer");

        ICourseAggregate iCourseAggregate = new CourseAggregateImpl();
        iCourseAggregate.add(designer);
        iCourseAggregate.add(ai);
        iCourseAggregate.add(python);
        iCourseAggregate.add(java);

        TYIterator<Course> tyitrerator = iCourseAggregate.tyItrerator();
        while (tyitrerator.hasNext()) {
            Course next = tyitrerator.next();
            System.out.println(next);
        }
    }
}
